<?php namespace Home\Controller; 
use Hdphp\Controller\Controller;
//文章详情控制器
class ArcController extends Controller{
	//文章详情页面
	public function index(){
		$aid = Q('get.aid',0,'intval');
		$arcModel = new \Common\Model\Arc;
		//点击次数+1
		//UPDATE article SET click=click+1 WHERE aid=$aid;
		$arcModel->where("aid={$aid}")->increment('click',1);
		//获得文章数据
		$data = $arcModel
				->join('category','category_cid','=','cid')
				->join('article_data','article_aid','=','aid')
				->where("aid=$aid")->find();
		//处理文章的标签
		$arcTagModel = new \Common\Model\ArcTag;
		$data['tag'] = $arcTagModel->join('tag','tag_tid','=','tid')->where("article_aid={$aid}")->get();
		View::with('data',$data);
	    View::make();
	}
}
?>